/*
 * Copyright (c) 2020, 2023, 3044483124@qq.com All rights reserved.
 *
 */

import java.util.ArrayList;
import java.util.Random;

/**
 * <p>Project: jdbc - Test
 * <p>Powered by jiangbo On 2023-02-13
 * 14:12:51
 * <p>Created by IntelliJ IDEA
 *
 * @author jiangbo [3044483124@qq.com]
 * @version 1.0
 * @since 8/17
 */
public class Test {
    public static void main(String[] args) {
        ArrayList<Integer> redBalls = new ArrayList<>();
        int blueBall;
        Random random = new Random();

        //生成6个不重复的红色球
        while (redBalls.size() < 6) {
            int ball = random.nextInt(33) + 1;
            if (!redBalls.contains(ball)) {
                redBalls.add(ball);
            }
        }

        //生成1个蓝色球
        blueBall = random.nextInt(16) + 1;

        System.out.println("红色球号码：" + redBalls);
        System.out.println("蓝色球号码：" + blueBall);
    }
}


